<?php
class User_model extends Mymodel {
	
	public $table_name = "user";
    function User_model()
    {
        parent::Mymodel();
    }

    function get_user_data($id=NULL, $condition=NULL)
    {
		return $this->get_data($this->table_name, $id, $condition);
	}
		
    function login_check( $username , $password , $encryption = 'md5' )
    {
		$where = array();
		$where['username'] = $username;
		$where['password'] = $password;
    	$data = $this->get_user_data(null,$where);
    	//var_dump($data['count']);exit;
    	return $data['count'] >= 1 ? $data[0] : false;
	}
		
	function insert_new_user($data)
	{
		//print_r($data);
		return $this->insert_new_record($this->table_name , $data);
	}
	
	function update_user_by_id($data, $id)
	{
		return $this->update_by_id($this->table_name, $data, $id);
	}
	
	function delete_user_by_id($id)
	{
		return $this->delete_by_id($this->table_name , $id);
	}
	
	
}


